<?php use application\Comm\Func;
$pager = new \application\Comm\Pager($page);?>
 <link rel="stylesheet" href="<?= Func::staticUrl('css/housing.css?v=20170610') ?>">
 <!--头部-->
 <!--列表页内容-->
<div class="household wrap">
    <div class="nav_link">
        <a href="<?= Func::createUrl('site/index')?>">首页</a>
        >
        <a href="javascript:;">家居实拍</a>
    </div>
    <div class="box">
        <div class="box_l">
        <!-- 此处是轮播广告 -->
            <div class="carousel">
                <div class="carousel_l">
                    <div class="pic">
                        <ul>
	                        <?php foreach ($carousel as $ckey => $cval){?>
	                            <li><img src="<?=$cval['src']?>"></li>
	                        <?php }?> 
                        </ul>
                        <a class="pre"></a>
                        <a class="next"></a>
                    </div>
                </div>
                <div class="carousel_r">
                    <i class="headline"></i>
                    <i class="diadema"></i>
                    <i class="portrait">
                        <img src="<?=$designer['src']?>">
                    </i>
                    <div class="wz">
                        <p class="name"><?=$designer['name']?></p>
                        <p><?=$designer['description']?></p>
                    </div>
                </div>
            </div>
            
         <!-- end此处是轮播广告 -->
            
            <div class="household_list">
                <div class="tit"><span>实拍精选</span></div>
                <ul>
                <?php foreach ($showhomedata as $showhomedatakey => $showhomedataval){?>
                    <li>
                    <a href="<?= Func::createUrl('showhome/view',['id'=>$showhomedataval['id']]);?>">
                        <div class="demonstrate">
                            <img src="<?=$showhomedataval['src'] ?>">
                        </div>
                        <div class="formulation">
                            <div class="tit"><?=$showhomedataval['title']?></div>
                            <p><?= $showhomedataval['description']?></p>
                            <div class="bt">
                                <div class="person">
                                    <img src="<?=$showhomedataval['thumb']?>">
                                </div>
                                <i class="by">by</i><span class="names"><?=$showhomedataval['user_name']?></span>
                                <div class="icon">
                                    <div>
                                        <i class="living"></i>
                                        <span><?=$showhomedataval['category_id']?></span>
                                    </div>
                                    <div>
                                        <i class="areas"></i>
                                        <span><?=$showhomedataval['acreage']?></span>
                                    </div>
                                    <div>
                                        <i class="kinds"></i>
                                        <span><?=$showhomedataval['style_id']?></span>
                                    </div>
                                </div>
                            </div>
                        </div>
                        </a>
                    </li>
                 <?php }?>
                </ul>
            </div>
        </div>
        <div class="box_r">
            <div class="hot">
                <div class="tit">
                    <span>热门装修案例</span>
                    <a href="javascript:;" class="more">更多》</a>
                </div>
                <div class="box">
                    <div class="zu">
	                    <?php foreach ($hotdata as $hotkey => $hotval){?>
	                        <div>
	                            <a href="<?=Func::createUrl('showhome/view',['id'=>$hotval['id']]);?>">
	                                <img src="<?=$hotval['src'] ?>">
	                            </a>
	                            <p><?=$hotval['title']?></p>
	                        </div>
	                    <?php }?>
                    </div>
               
                </div>
            </div>
            <div class="sign">
                    <?php  include_once dirname(__FILE__).'/../common/apply.php'; ?>
            </div>

        </div>
    </div>
    <div style="margin-top: 20px" class="paging_list">
        <?= $pager->show(2)?>
    </div>
</div>
<script type="text/javascript">
    //轮播函数
    function lun(a){
        var ul_=a.find('ul');
        var li_=a.find('ul li');
        var li_witch= li_.width();
        var num_=li_.length;
        ul_.css({'width':li_witch*num_});
        var pre= a.find('.pre');
        var next= a.find('.next');
        var i=0;
        next.click(function(){
            i++;
            if(i>=num_){
                i=num_-1;
            }
            tab(i);
        })
        pre.click(function(){
            i--;
            if(i<0){
                i=0;
            }
            tab(i);
        })
        function tab(i){
            ul_.stop(true).animate({'left':-i*li_witch});
        }
    }
    lun($('.pic'));
</script>
